<template>
  <view>
    <view class="special-work-list__item">
      <text class="special-work-list__label">岗位：</text>
      <text class="special-work-list__value">{{ detail.postName }}</text>
    </view>
    <view class="special-work-list__item">
      <text class="special-work-list__label">设备名称：</text>
      <text class="special-work-list__value">{{ detail.position }}</text>
    </view>
    <view class="special-work-list__item">
      <text class="special-work-list__label">实施时间：</text>
      <text class="special-work-list__value">
        {{ actualDateLabel }}
      </text>
    </view>
  </view>
</template>

<script>
import { staticUrl } from '@/config.js'
export default {
  props: {
    detail: {
      type: Object,
      default: () => ({})
    },
    ticket: {
      type: Object,
      default: () => ({})
    },
    inspect: {
      type: Object,
      default: () => ({})
    },
    actualDateLabel: String
  },
  data() {
    return {
      staticUrl
    }
  },
  computed: {
    workPatternLabel() {
      if (!this.detail.workPattern) {
        return ''
      }
      const workPattern = []
      this.detail.workPattern.forEach((item) => {
        workPattern.push(item.label)
      })
      if (this.detail.otherWorkPattern) {
        workPattern.push(this.detail.otherWorkPattern)
      }
      return workPattern.join('，')
    },
    craftImages() {
      let images = this.detail.images[0].split(',')
      return images
    }
  },
  methods: {
    handlePreviewImage(url) {
      uni.previewImage({
        urls: [url]
      })
    }
  }
}
</script>

<style scoped lang="scss">
@import '../style/style.scss';
</style>
